-
Notifications
You must be signed in to change notification settings - Fork 166
Added batching mode #61
base: master
Are you sure you want to change the base?
Conversation
What is the purpose of this? UDP doesn't do any handshaking, so there is no performance gain by batching these calls. From what I can tell it does not much more than delay the sending of the metrics. Can you further elaborate on what this is designed to accomplish? Furthermore, delaying metrics getting sent to the StatsD daemon which already rolls up data by time-window, may throw off the metrics getting sent to the server depending on what the time-window for StatsD is versus the time window here. |
|
Fair enough. It looks like the |
@devdazed Indeed, great catch, thank you. I'll fix that in an hour and notify you. Also thought it worths making the delays and message limit configurable |
I think so, having those be configurable would be optimal. |
@devdazed Done:
|
this looks good to me @sivy thoughts? |
@devdazed I've amended the PR a bit. Realised it's better not to limit the number of messages in a batch, but the actual batch size, as that's what matters. |
if your goal is to come in less than the MTU then shouldn't the packet header lengths be taken into account? |
@devdazed That's why I'm not calling the option |
Please excuse my other-project interruption, but this feels like the best place to comment. Since nothing has been getting pulled into this project for awhile, I have been watching things here and pulled into a fork, https://github.com/brightcove/hot-shots. I was just looking to pull this in, but I see it duplicates a lot that's already in #60, so I'm going to have to skip it. (The one big difference is to add a batch delay, but that's not easy to merge as-is on top of the other changes.) |
Added
batch
option, if true, the messages are batched either by 20 messages or by 1 second. Message of different kinds could be mixed in the batch. Callbacks for individual messages are called when the batch is sent.Several tests included, verifying that the new mode works as expected.